#include <iostream>
#include <vector>
#include<string>
#include <algorithm>
using namespace std;

//用户类：记录基本信息+关联订单
class User{
private:
    string userId;//用户Id
    string userName;//姓名
    vector<string> bookedFlights;//关联的航班号

public:
    User(const string& id, const string& name) : userId(id), userName(name) {}

    string getUserName() const { return userId; }
    string getUserId() const { return userName; }

    //关联航班（订票成功时调用）
    void addBookedFlight(const string& flightNo) {
        bookedFlights.push_back(flightNo);
    }

    //取消关联航班（退票成功时调用）
    void removeBookedFlight(const string& flightNo) {
        auto it = find(bookedFlights.begin(), bookedFlights.end(), flightNo);
        if (it != bookedFlights.end()) {
            bookedFlights.erase(it);
        }
    }

    //显示用户信息+已订航班
    void showInfo() const{
        cout << "用户ID: " << userId <<" : | 姓名: " << userName << endl;
        if(!bookedFlights.empty()){
            cout << "已订航班：";
            for(const auto& f : bookedFlights) cout << f << ";";
            cout << endl;
        }
    }
};